<script lang="ts" setup>
import { reactive, ref, watch } from 'vue';

  const count = ref(0);
  const user = reactive({
    name: "张三",
    info: {
      gender: "男",
      age: 18,
    },
  });
  watch(()=>user.info.age, () => {
   console.log('被监听了');
  });
</script>

<template>
<button @click="count++">数字++</button>
<button @click="user.name='王五'">改名</button>
<button @click="user.info.age++">年龄++</button>
</template>

<style scoped></style>